/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package fr.ove.openmath.jome.ctrlview.bidim;

/**
 *
 * @author Mr.Sam
 */
import java.awt.*;
import fr.ove.openmath.jome.ctrlview.bidim.DisplayLayout;
import fr.ove.openmath.jome.ctrlview.bidim.Display;
import fr.ove.openmath.jome.ctrlview.bidim.StringDisplay;
import fr.ove.openmath.jome.ctrlview.bidim.selection.events.SelectionEvent;

/**
* A layout manager that lays strings.
*
* @author © 1998 DIRAT Laurent
* @version 1.0  23/06/98
*/
public class StringLayout extends AbstractStringLayout {
    /**
    * Returns <CODE>true</CODE> if during the selection, the display which is located
    * to the left of the display that lays the instance, must be selected too.
    * <CODE>false</CODE> otherwise.
    */
    public boolean selectLeftDisplay() {
        if (displayToLay.isSelected() && displayToLay.isSymbolOperatorDisplay())
            return true;
        else
            return false;
    }
    
    /**
    * Returns <CODE>true</CODE> if during the selection, the display which is located
    * to the right of the display that lays the instance, must be selected too.
    * <CODE>false</CODE> otherwise.
    */
    public boolean selectRightDisplay() {
        if (displayToLay.isSelected() && displayToLay.isSymbolOperatorDisplay())
            return true;
        else
            return false;
    }

    /**
    * Checks the validity of the selection.
    */
    public void validateSelection() {
    }
    
    /**
    * Checks the validity of the deselection.
    * @param display the display to deselect.
    */
    public void validateDeselection(Display display) {
    }
}
